<?php
defined('SYSPATH') OR die('No direct access allowed.');
/**
 * pglmnorganisasi.php
 * @author ranuandra
 *
 * 26 Mei 2012 13:19:10
 *
 * 
 */

class Model_Pglmnorganisasi extends ORM
{
	
	protected $_belongs_to = array(
		'mstpelamar'  => array('model' => 'mstpelamar')
	);
	
	private $_field = array('nama_organisasi', 'posisi', 'lama', 'mstpelamar_id');
	private $_form = array(
							'nama_organisasi' => '', 
							'posisi' => '', 
							'lama' => '',
						);
						
	public function rules()
	{
		return array(
							'nama_organisasi' => array(
												array('not_empty'),
										), 
							'posisi' => array(
												array('not_empty'),
										),
							'lama' => array(
												array('min_length', array(':value', 0)),
										), 
		);		
	}
	
	public function getField()
	{
		return $this->_field;
	}
	
	public function getForm()
	{
		return $this->_form;
	}
	
	public function create_data($values)
	{
	    return $this->values($values, $this->_field)->create();
	}
}